package cn.iocoder.yudao.module.pay.order.vo;

import cn.hutool.core.util.StrUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.AssertTrue;
import lombok.Data;

@Schema(description = "用户 APP - 付款单据获取 Request VO")
@Data
@Valid
public class AppPayOrderDetailReqVO {

    @Schema(description = "支付编号", example = "1863170925660639233")
    private Long id;

    @Schema(description = "支付单号", example = "PAY202412011838591")
    private String payNo;

    @Schema(description = "交易单号", example = "SHP2024111116038888")
    private String tradeNo;

    @SuppressWarnings("unused")
    @AssertTrue(message = "支付编号、支付单号和交易单号不能同时为空")
    public boolean validateNo() {
       return  (id != null && id > 0) || StrUtil.isNotBlank(payNo) || StrUtil.isNotBlank(tradeNo);
    }

    @Schema(description = "是否同步订单的第三方支付渠道的支付状态", example = "false")
    private Boolean sync;

}
